<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <input id="input1" type="text">
     + 
     <input id="input2" type="text"> 
     <button id="btn"> = </button> 
     <span id="result"></span>
    <script>
        var input1 = document.getElementById('input1');
        var input2 = document.getElementById('input2');
        var result = document.getElementById('result');
        var btn = document.getElementById('btn');

        btn.onclick = function(){
            console.log(typeof input1.value);
            result.innerHTML = input1.value + input2.value;
        }
    </script>
</body>
</html>